<?php
/**
 * Created by PhpStorm.
 * User: renbin
 * 功能：常用正则类
 * Date: 2015/6/9
 * Time: 9:27
 */

namespace common\models;


class Validate {
    //银行借记卡
    public static $bank_card = array('rule'=>"/^[0-9]{16,19}$/", 'msg'=>'银行卡错误，请输入正确的银行卡号！');

    //身份证
    public static $identity = array('rule'=>"/(^[0-9]{15}$)|(^[0-9]{17}([0-9]|X|x)$)/", 'msg'=>'身份证错误，请输入15位或者18位字符！');

    //姓名
    public static $name = array('rule'=>"/^[\x{4e00}-\x{9fa5}_a-zA-Z]{2,10}$/u", 'msg'=>'请输入2-10位字母、汉字的姓名！');


    //金钱两位小数
    public static $money = array('rule'=>"/^[0-9]+([.]{0,1}[0-9]{0,2})$/", 'msg'=>'请输入正确格式的金额。');

    //银行编号
    public static $bank_code = array('rule'=>"/^[0-9]{8}$/", 'msg'=>'请选择支付的银行卡！');

    //银行编号
    public static $bank_id = array('rule'=>"/^\S{1,}$/", 'msg'=>'请选择正确的银行卡！');

    //银行支行信息
    public static $bank_branch = array('rule'=>"/^\S{1,100}$/", 'msg'=>'请选择正确的银行卡！');

    public static $password = array('rule'=>"/^\S{6,20}$/",'msg'=>'请输入一个6-20位的密码');

    //用户名
    public static $user_name = array('rule'=>"/^[\x{4e00}-\x{9fa5}_a-zA-Z]{2,10}$/u", 'msg'=>'用户名错误，请输入3到10位只能含有字母、数字、下划线！');

    //手机号
    public static $tel = array('rule'=>"/^1[3|4|5|7|8][0-9]\d{8}$/", 'msg'=>'手机号为11位有效数字！');
	//推荐人手机号
    public static $rec = array('rule'=>"/^1[3|4|5|7|8][0-9]\d{8}$/", 'msg'=>'手机号为11位有效数字！');

    //验证码
    public static $code = array('rule'=>"/^\d{1,4}$/", 'msg'=>'验证码为4位数字！');

    public static $id = array('rule'=>"/^([1-9])|([1-9]\d)$/", 'msg'=>'页面失效，请刷新页面！如无法解决，请联系客服。');


}